const { exec } = require('../db/mysql')

//login接口
const login = (username, password) => {
    const sql=`select realname,username from users where username='${username}' and password='${password}'`

    return exec(sql).then(rows=>{
        console.log(rows)
        return rows[0] || {}
    })
}

module.exports = {
    login
}




